#include"include.h"

int recvData(int sock, void *buf, int len)
{
   int msgSize;
   int acquired = 0;
   while(acquired < len)
   {
      if((msgSize = recv(sock, buf + acquired, len - acquired, 0)) <= 0)
      {
         return 1;
      }
      acquired += msgSize;
   }
   return 0;
}
